﻿@using IdentityServer4.Extensions
@using AbpZeroTemplate.MultiTenancy.Payments
@using AbpZeroTemplate.Web.Resources
@model AbpZeroTemplate.Web.Models.Payment.PaymentViewModel
@inject IWebResourceManager WebResourceManager
@{
    WebResourceManager.AddScript("https://www.paypalobjects.com/api/checkout.js");
    WebResourceManager.AddScript(ApplicationPath + "view-resources/Views/Payment/_PayPal.js");
}

<input type="hidden" id="paypal-environment" value="@Model.GetAdditionalData(SubscriptionPaymentGatewayType.Paypal, "Environment")" />
<input type="hidden" name="PaymentId" value="" />
<input type="hidden" name="PayerId" value="" />
@if (!Model.GetAdditionalData(SubscriptionPaymentGatewayType.Paypal, "DemoUsername").IsNullOrEmpty())
{
    <div class="m-alert m-alert--icon m-alert--icon-solid m-alert--outline alert alert-brand alert-dismissible fade show" role="alert">
        <div class="m-alert__icon">
            <i class="flaticon-exclamation" aria-label="@L("Payment")"></i>
            <span></span>
        </div>
        <div class="m-alert__text">
            <h4>
                @L("DemoPayPalAccount")
            </h4>
            <p>
                <span>@L("UserName"): <strong>@Model.GetAdditionalData(SubscriptionPaymentGatewayType.Paypal, "DemoUsername")</strong></span><br />
                <span>@L("Password"): <strong>@Model.GetAdditionalData(SubscriptionPaymentGatewayType.Paypal, "DemoPassword")</strong></span>
            </p>
        </div>
    </div>
}
<div id="paypal-button"></div>